package com.ribbon.ribbonServer;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @GetMapping("/person/{id}")
    public Map person(@PathVariable Long id, HttpServletRequest request){
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("url", request.getRequestURL().toString());
        return map;
    }




}
